/**
 * 
 */
package fr.lelouet.ga;

/**
 * A stopper is supposed to say to an algorithm when it should stop searching
 * values<br />
 * It is not supposed to be shared by Algorithms, for when one algorithm uses it
 * it calls the {@link #restart()} method.
 * @author le louet
 */
public interface Stopper<T> {

  /**
   * prepares the stopper to handle a new algorithm <br />
   * This is used only once each time the algorithms prepares to search a new
   * solution
   */
  public void restart();

  /**
   * @return should the algorithm stop generating elements ?<br />
   *         Only used once for each generation
   */
  public boolean stop(Generation<T> generation);

}
